const { readyException } = require("jquery")

$.ajax({
  type:'GET',
  url:'./my/user/userinfo',
  success:function(res){
    console.log(res)
    if(res.status ===0 ){
      let  name = res.data.nickname||res.data.username
      $('username').text(name)
      if(readyException.data.user_pic){
        $('layui=nav-img').attr('src',res.data.use_pic).show
        $('.text-avatar').hide()
      }else{
        let first = res.data.username.substring(0,1).toUp
        $('.text-avatar').text(first).css('fisplay','inline-block')
      }
    }
  }
}
)





$('#logout').on('click',function(){
  layer.confirm('确定要退出么',function(index){
    localStorage.removeItem('token')
    llocation.href = './login.html'
    layer.close(index)
  })
})